# | start move.l sp | a5 start the program!
|
---|
1 | move.l #ustk | sp Make space available... |
2 | move.l 4(a5) | a5 |
3 | move.l $c(a5) | d0 |
4 | add.l $14(a5) | d0 |
5 | add.l $1c(a5) | d0 |
6 | add.l #$100 | d0 |
7 | move.l d0 | size |
8 | move.l d0 | -(sp) |
9 | move.l a5 | -(sp) |
10 | move.w d0 | -(sp) |
11 | move.w #$4a | -(sp) |
12 | trap #1 and free up unused memory |
13 | add.l #12 | sp accordingly. |
14 | gosuper clr.l -(sp) enter supervisor mode |
15 | move.w #32 | -(sp) |
16 | trap #1 |
17 | addq #6 | sp |
18 | move.l d0 | savestk keep track of the old stack |
19 | install suba.l a4 | a4 install the reset-program. |
20 | move.l #$31415926 | d0 magic number. |
21 | move.l d0 | $426(a4) RESVALID |
22 | move.l #go | d0 reset program address. |
23 | move.l d0 | $42a(a4) RESVECTOR |
24 | gouser move.l savestk | -(sp) go back to user mode now |
25 | move.w #32 | -(sp) |
26 | trap #1 |
27 | addq #6 | sp |
28 | exit clr.w -(sp) and finish the installation. |
29 | move.l size | d0 |
30 | move.l d0 | -(sp) |
31 | move.w #49 | -(sp) |
32 | trap #1 |
33 | go sub.l a4 | a4 Start of the reset-program. |
34 | move.l #0 | $426(a4) clear the program from memory |
35 | move.l #0 | $42a(a4) after a reset! |
36 | newbit lea $FFFF8800 | a0 Just replacing $FC0084 of |
37 | move.b #$7 | (a0) the ROM here | because we want to |
38 | move.b #$C0 | $2(a0) skip over the original version. |
39 | move.b #$E | (a0) |
40 | move.b #$7 | $2(a0) |
41 | move.b $fc001d | d0 |
42 | btst #$0 | d0 |
43 | beq continue |
44 | lea continue(pc) | a6 |
45 | move.l #$fc0e1a | a5 |
46 | jmp (a5) |
47 | continue move.l #$ff820a | a5 Right... the frequency address. |
48 | move.b #0 | d0 D0 holds the new frequency. |
49 | move.b d0 | (a5) 0 for 60Hz | and 2 for 50Hz. |
50 | move.l #$fc00b6 | a6 Continue with original part of |
51 | jmp (a6) the ROM... |
52 | ds.l 20 Stack space... stack grows |
53 | ustk ds.l 1 downwards. |
54 | size ds.l 1 Size of memory to keep |
55 | savestk ds.l 1 old stack pointer.
|